/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 1.0.4</a>, using an XML
 * Schema.
 * $Id$
 */

package com.jzhao.jpre.format.sequential.castor;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;

/**
 * Class TLVMsgFieldChoice.
 * 
 * @version $Revision$ $Date$
 */
public class TLVMsgFieldChoice implements java.io.Serializable {


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field _fixedLength
     */
    private int _fixedLength;

    /**
     * keeps track of state for field: _fixedLength
     */
    private boolean _has_fixedLength;

    /**
     * Field _variableLength
     */
    private int _variableLength;

    /**
     * keeps track of state for field: _variableLength
     */
    private boolean _has_variableLength;


      //----------------/
     //- Constructors -/
    //----------------/

    public TLVMsgFieldChoice() 
     {
        super();
    } //-- com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     */
    public void deleteFixedLength()
    {
        this._has_fixedLength= false;
    } //-- void deleteFixedLength() 

    /**
     */
    public void deleteVariableLength()
    {
        this._has_variableLength= false;
    } //-- void deleteVariableLength() 

    /**
     * Returns the value of field 'fixedLength'.
     * 
     * @return the value of field 'FixedLength'.
     */
    public int getFixedLength()
    {
        return this._fixedLength;
    } //-- int getFixedLength() 

    /**
     * Returns the value of field 'variableLength'.
     * 
     * @return the value of field 'VariableLength'.
     */
    public int getVariableLength()
    {
        return this._variableLength;
    } //-- int getVariableLength() 

    /**
     * Method hasFixedLength
     * 
     * 
     * 
     * @return true if at least one FixedLength has been added
     */
    public boolean hasFixedLength()
    {
        return this._has_fixedLength;
    } //-- boolean hasFixedLength() 

    /**
     * Method hasVariableLength
     * 
     * 
     * 
     * @return true if at least one VariableLength has been added
     */
    public boolean hasVariableLength()
    {
        return this._has_variableLength;
    } //-- boolean hasVariableLength() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return true if this object is valid according to the schema
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * 
     * 
     * @param out
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * 
     * 
     * @param handler
     * @throws java.io.IOException if an IOException occurs during
     * marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Sets the value of field 'fixedLength'.
     * 
     * @param fixedLength the value of field 'fixedLength'.
     */
    public void setFixedLength(int fixedLength)
    {
        this._fixedLength = fixedLength;
        this._has_fixedLength = true;
    } //-- void setFixedLength(int) 

    /**
     * Sets the value of field 'variableLength'.
     * 
     * @param variableLength the value of field 'variableLength'.
     */
    public void setVariableLength(int variableLength)
    {
        this._variableLength = variableLength;
        this._has_variableLength = true;
    } //-- void setVariableLength(int) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @throws org.exolab.castor.xml.MarshalException if object is
     * null or if any SAXException is thrown during marshaling
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     * @return the unmarshaled
     * com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice
     */
    public static com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice) Unmarshaller.unmarshal(com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice.class, reader);
    } //-- com.jzhao.jpre.format.sequential.castor.TLVMsgFieldChoice unmarshal(java.io.Reader) 

    /**
     * 
     * 
     * @throws org.exolab.castor.xml.ValidationException if this
     * object is an invalid instance according to the schema
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
